<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<html>
<head>
	<meta charset="UTF-8" />
	<title>客户管理-首页</title>
	<link href="/js/plugin/layui-v2.3.0/layui/css/layui.css" rel="stylesheet" />
	<link href="/css/reset.css" rel="stylesheet" />
	<link href="/css/index.css" rel="stylesheet" />
	<link href="/css/client.css" rel="stylesheet" />
	<script src="/js/jquery-2.1.1.min.js"></script>
    <script src="/js/plugin/layui-v2.3.0/layui/layui.js"></script>
    <script src="/js/common.js"></script>
</head>
<style>
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
    background-color: #F5F5F5;
    cursor: pointer;
}
::-webkit-scrollbar-thumb {
    background-color: #a2a2a2;
    border-radius: 2px;
}

body{
	height: auto;
}

/* //加载更多 */
.layui-flow-more a cite{
	display: block !important;
	background:transparent;
	color:#62a8e9;
	font-size:14px;
	border:1px solid #62a8e9;
	
	border-radius:22px;
}
</style>
<body >
<input type="hidden" name="teamId" id="teamId" th:value="${id}"/>
<div class="kb-out-box">
	<header class="nav-header flex-center">
		<div class="chart-box" style="margin-right: 215px;">
			<a href="javascript:void(0)">
				<div class="statistic-box">
					<div class="statistic-box">
						<div class="header">
							<span class="number" id="newAddcus" th:text="${record==null} ?0:${record.existingBalance}"></span>
						</div>
						<div class="newAddcusName">
							<span class="date-type">积分余额</span>
						</div>
					</div>
				</div>
			</a>
		</div>
		<div class="chart-box" style="margin-right: 215px;">
			<a href="javascript:void(0)">
				<div class="statistic-box">
					<div class="statistic-box">
						<div class="header">
							<span class="number" id="win" th:text="${record==null} ?0:${record.baseBalance}"></span>
						</div>
						<div class="winName">
							<span class="date-type">基础积分</span>
						</div>
					</div>
				</div>
			</a>
		</div>
		<div class="chart-box" style="margin-right: 75px;">
			<a href="javascript:void(0)">
				<div class="statistic-box">
					<div class="statistic-box">
						<div class="header">
							<span class="number" id="lose" th:text="${record==null} ?0:${record.giftBalance}"></span>
						</div>
						<div class="loseName">
							<span class="date-type">赠送积分</span>
						</div>
					</div>
				</div>
			</a>
		</div>
	</header>
	<table class="layui-hide" id="LAY_table_integral" lay-filter="integral"></table> 
	<script id="baseRecharge" type="text/html">
		{{# if(d.baseRecharge!=null){  }}
			<span style="color: rgb(37, 195, 36);">+{{d.baseRecharge}}</span>
		{{# }else{ }}
			<span style="color: rgb(37, 195, 36);">+0</span>
		{{# } }}
	</script>
	<script id="giftRecharge" type="text/html">
		{{# if(d.giftRecharge!=null){  }}
			{{# if(d.type==2){ }}
				<span style="color: rgb(37, 195, 36);">+{{d.giftRecharge}}</span>
			{{# }else{ }}
				<span style="color: rgb(255, 0, 0);">-{{d.giftRecharge}}</span>
			{{# } }}
			
		{{# }else{ }}
			<span style="color: rgb(37, 195, 36);">+0</span>
		{{# } }}
	</script>	
	<script id="paymentMethod" type="text/html">
		{{# if(d.paymentMethod==="cash"){  }}
			现金支付
		{{# }else if(d.paymentMethod==="point"){  }}
			积分支付
		{{# }else if(d.paymentMethod==="manually"){  }}
			人工核销
		{{# }else if(d.paymentMethod==="pos"){  }}
			pos支付
		{{# }else if(d.paymentMethod==="union_pay"){  }}
			银联支付
		{{# }else if(d.paymentMethod==="wechat_offline"){  }}
			微信（线下）
		{{# }else if(d.paymentMethod==="alipay_offline"){  }}
			支付宝（线下）
		{{# }else if(d.paymentMethod==="balance"){  }}
			余额付款
		{{# }else if(d.paymentMethod==="credit"){  }}
			会员资源支付
		{{# }else if(d.paymentMethod==="other"){  }}
			其他
		{{# }else{ }}
			无
		{{# } }}
	</script>
					  
</div>

<script>
$(function(){
	
	var teamId=$("#teamId").val();
	layui.use(['element','table','layer'], function(){
		  var element = layui.element;
		  table = layui.table;
		//方法级渲染
			table.render({
				id:'integral',
			    elem: '#LAY_table_integral',
			    url: '/app/customerIntegral/listdata',
			    cols: [[
			      {field:'baseRecharge' , toolbar:'#baseRecharge', align:'left', title: '基础余额',width:'12%'}
			      ,{field:'giftRecharge' , toolbar:'#giftRecharge' , align:'left', title: '赠送余额',width:'12%'}
			      ,{field:'existingBalance', align:'left', title: '现有余额',width:'12%'}
			      ,{field:'paymentMethod', toolbar:'#paymentMethod', align:'left', title:'支付方式',width:'12%' }
			      ,{field:'creater', align:'left', title:'充值人员',width:'8%' }
			      ,{field:'remarks', align:'left', title:'备注',width:'17%' }
			      ,{field:'created', align:'left', title:'交易时间',width:'21.2%' }
			    ]]
			    ,page: true
			    ,where: {
		        	params:{teamId:teamId}
		        },
		        done:function(){
		        	setHeight();
		        }
			});
			
		});
	parent.$("#jifen").html($("#newAddcus").text());
})
/* 根据iframe的内容撑开iframe的容器 */
function setHeight(){
    var h = document.body.offsetHeight*1;
    window.parent.parentHeight(h);
}
</script>

</body></html>